﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Admin.Master" AutoEventWireup="true" CodeBehind="JogoCadastro.aspx.cs" Inherits="GamePlusAdmin.JogoCadastro" %>
<%@ Register src="UserControl/AutoCompleteTags.ascx" tagname="AutoCompleteTags" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" language="javascript">
        function autoCompleteCallBack(selectedID, fieldID) {
            if (fieldID.indexOf('acTagsPrincipal') >= 0)
                $('#ctl00_ContentPlaceHolder1_IdTagPrincipal').val(selectedID);
            else {
                $('#ctl00_ContentPlaceHolder1_IdTag').val(selectedID);
                $('#ctl00_ContentPlaceHolder1_btnAdicionarTag').click();
                $('html').scrollTop($('#ctl00_ContentPlaceHolder1_btnAdicionarTag').position().top);
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>Cadastro de novo jogo</h1>
    <asp:HiddenField runat="server" ID="IdTagPrincipal" Value="" />
    <asp:HiddenField runat="server" ID="IdTag" Value="" />
    <table>
        <tr>
            <td class="label"><label>Tipo do Jogo:</label></td>
            <td class="container">
                <asp:RadioButtonList runat="server" ID="rdTipoJogo">
                    <asp:ListItem Value="1" Text="Mochimedia"></asp:ListItem>
                    <asp:ListItem Value="2" Text="Link Flash"></asp:ListItem>
                    <asp:ListItem Value="3" Text="Código Completo"></asp:ListItem>
                    <asp:ListItem Value="4" Text="Hospedado no Site"></asp:ListItem>
                    <asp:ListItem Value="5" Text="Nova Janela"></asp:ListItem>
                    <asp:ListItem Value="6" Text="Atrativa"></asp:ListItem>
                    <asp:ListItem Value="7" Text="Barra Gameplus"></asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>   
        <tr>
            <td class="label"><label>Nome:</label></td>
            <td class="container"><asp:TextBox runat="server" ID="txtNome" Width="500px"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="label"><label>Chamada: (Highlight)</label></td>
            <td class="container"><asp:TextBox runat="server" ID="txtChamada" TextMode="MultiLine" Rows="8" Columns="61"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="label"><label>Descrição:</label></td>
            <td class="container"><asp:TextBox runat="server" ID="txtInstrucoes" TextMode="MultiLine" Rows="8" Columns="61"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="label"><label>Tag Principal</label></td>
            <td class="container">
                <uc1:AutoCompleteTags ID="acTagsPrincipal" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="label"><label>Tags</label></td>
            <td class="container">
                <uc1:AutoCompleteTags ID="acTags" runat="server" />
                <div style="display: none;"><asp:Button runat="server" ID="btnAdicionarTag" OnClick="btnAdicionarTag_Click" /></div>
                <asp:GridView runat="server" ID="gvTags" AutoGenerateColumns="False" 
                    EnableModelValidation="True" DataKeyNames="Idf_Tag">
                    <Columns>
                        <asp:BoundField HeaderText="Tag" DataField="Des_Tag" />
                        <asp:CommandField ButtonType="Button" DeleteText="Remover" 
                            ShowDeleteButton="True" />
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td class="label"><label>Comandos</label></td>
            <td class="container">
                <asp:DropDownList runat="server" ID="ddlComando"></asp:DropDownList>
                <asp:Button runat="server" ID="btnAdicionarComando" Text="Adicionar" />
                <asp:GridView runat="server" ID="gvComandos"></asp:GridView>
            </td>
        </tr>
        <tr>
            <td class="label"><label>Arquivo Flash</label></td>
            <td class="container"><asp:FileUpload runat="server" ID="fuArquivoFlash" /></td>
        </tr>
        <tr>
            <td class="label"><label>Referência URL</label></td>
            <td class="container"><asp:TextBox runat="server" ID="txtURLRef" Width="500px"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="label"><label>Código HTML ou Link para o Flash</label></td>
            <td class="container"><asp:TextBox runat="server" ID="txtHTMLFlashLink" TextMode="MultiLine" Rows="8" Columns="61"></asp:TextBox></td>
        </tr> 
        <tr>
            <td class="label"><label>Metadata (.json)</label></td>
            <td class="container"><asp:FileUpload runat="server" ID="fuMetadata" /></td>
        </tr>
        <tr>
            <td class="label"><label>Logo</label></td>
            <td class="container"><asp:FileUpload runat="server" ID="fuLogo" /></td>
        </tr>
        <tr>
            <td class="label"><label>Destaque Grande (414x272)</label></td>
            <td class="container"><asp:FileUpload runat="server" ID="fuDestaqueGrande" /></td>
        </tr>
        <tr>
            <td class="label"><label>Destaque Pequeno (261 x 129)</label></td>
            <td class="container"><asp:FileUpload runat="server" ID="fuDestaquePequeno" /></td>
        </tr>
        <tr>
            <td colspan="2"><asp:Button runat="server" ID="btnSalvar" Text="Salvar" OnClick="btnSalvar_Click" /></td>
        </tr>
    </table>
</asp:Content>
